package org.example.Controller;

import org.example.Pojo.Orders;
import org.example.Service.Impl.OrdersServiceImpl;
import org.example.Utils.RequirePermission;
import org.example.Utils.UnionResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Orders")
public class OrdersController {
    @Autowired
    OrdersServiceImpl ordersServiceImpl;
    @RequestMapping("/addOrder")
    public UnionResult addOrder(Orders orders) {
        return ordersServiceImpl.addOrder(orders);
    }
    @RequestMapping("/queryMyOrder")
    public UnionResult queryMyOrder(Orders orders) {
        return ordersServiceImpl.QueryMyOrder(orders);
    }
    @RequirePermission(value = "m:order")
    @RequestMapping("/queryAllOrder")
    public UnionResult queryAllOrder(Orders orders) {
        return ordersServiceImpl.QueryAllOrder();
    }
    @RequirePermission(value = "m:order")
    @RequestMapping("/sendOrder")
    public UnionResult sendOrder(Orders orders) {
        return ordersServiceImpl.SendOrder(orders);
    }
}
